

// Declare app level module which depends on filters, and services
var app = angular
.module('myApp',
	[ 'myApp.filters', 'myApp.services', 'myApp.directives' ]);
app.config(
	[
	'$routeProvider',
	'$locationProvider',
	'$httpProvider',
	function($routeProvider, $locationProvider,
		$httpProvider) {
		$routeProvider.when('/modelvalidate', {
			templateUrl : 'views/modelvalidate.html',
			controller : ModelvalidateCtrl
		}).when('/modelrevise', {
			templateUrl : 'views/modelrevise.html',
			controller : ModelreviseCtrl
		}).when('/decisionsupt', {
			templateUrl : 'views/decisionsupt.html',
			controller : DecisionsuptCtrl
		}).when('/sysmanage', {
			templateUrl : 'views/sysmanage.html',
			controller : SysmanageCtrl
		}).otherwise({
			redirectTo : '/modelvalidate'
		});
		$locationProvider.html5Mode(true);
							//
							// initialize get if not there
							if (!$httpProvider.defaults.headers.get) {
								$httpProvider.defaults.headers.get = {};
							}

							// Answer edited to include suggestions from
							// comments
							// because previous version of code introduced
							// browser-related errors

							// disable IE ajax request caching
							$httpProvider.defaults.headers.get['If-Modified-Since'] = 'Mon, 26 Jul 1997 05:00:00 GMT';
							// extra
							$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
							$httpProvider.defaults.headers.get['Pragma'] = 'no-cache';
						} ]);
app.directive('datePicker', function() {  
	return {  
		restrict: 'AE',
		require: '?ngModel',
		link: function(scope, element, attr, ngModel) {
			if (!ngModel) return;
			element.on("click",function () {
				//alert("asdf");
				WdatePicker({
					onpicked: function () {
						scope.$apply(ngModel.$setViewValue(this.value));
					}
				});
			});
		}
	}  
});  